<br />
<br />
<br />

<p class='text-center lead'>{project_code} {project_name} 的管道等级表：</p>
<form class="form-horizontal" role="form" action = 'http://<?php echo base_url("index.php/pdms_pms/index"); ?>' method = "post">
	<input type = "hidden" name = "form2" value = "1" />
	<input type = "hidden" name = "project_id" value = "{project_id}" />
	<div class="form-group">
		<label for="pipe_class" class="col-md-1 control-label">管道等级：</label>
		<div class="col-md-2">
			<input type = "text"  class="form-control" name = "pipe_class"/>
		</div>
		<div class="col-md-9"></div>
	</div>
	<div class="form-group">
	    <label for="type" class="col-md-1 control-label">类别：</label>
		<div class="col-md-2">
			<select class="form-control" name='type' id='type'>
				<option value='_'>请选择</option>
			{types}
				<option value='{code}'>{des}</option>
			{/types}
			</select>
		</div>
		<label for="standard" class="col-md-1 control-label">标准：</label>
		<div class="col-md-2">
			<select class="form-control" name='standard' id='standard'>
				<option value='__'>请先选择类别</option>
			</select>
		</div>
		<label for="subtype" class="col-md-1 control-label">子类：</label>
		<div class="col-md-2">
			<select class="form-control" name='subtype' id='subtype'>
				<option value='_'>请先选择类别</option>
			</select>
		</div>
		<label for="contype" class="col-md-1 control-label">连接：</label>
		<div class="col-md-2">
			<select class="form-control" name='contype' id='contype'>
				<option value='_'>请选择</option>
			{contypes}
				<option value='{code}'>{des}</option>
			{/contypes}
			</select>
		</div>
	</div>
	<div class="form-group">
		<label for="classthk" class="col-md-1 control-label">壁厚/压力：</label>
		<div class="col-md-2">
			<select class="form-control" name='classthk' id='classthk'>
				<option value='__'>请选择</option>
			{classthks}
				<option value='{code}'>{des}</option>
			{/classthks}
			</select>
		</div>
		<label for="min_dn" class="col-md-1 control-label">MinDN：</label>
		<div class="col-md-2">
			<select class="form-control" name='min_dn' id='min_dn'>
				<option value='_'>请选择</option>
			{sizes}
				<option value='{dn}'>{dn}</option>
			{/sizes}
			</select>
		</div>
		<label for="max_dn" class="col-md-1 control-label">MaxDN：</label>
		<div class="col-md-2">
			<select class="form-control" name='max_dn' id='max_dn'>
				<option value='_'>请选择</option>
			{sizes}
				<option value='{dn}'>{dn}</option>
			{/sizes}
			</select>
		</div>
		<label for="material" class="col-md-1 control-label">材料：</label>
		<div class="col-md-2">
			<select class="form-control" name='material' id='material'>
				<option value='____'>请先选择类别</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<div class="col-md-1"></div>
		<div class="col-md-2">
			<input class="btn btn-success btn-sm" type = "submit" value="添加"/> 
			<a class='btn btn-danger btn-sm' href='http://<?php echo base_url(); ?>index.php/pdms_pms/export_txt/{project_id}/{pipe_class}' role='button' traget='_blank'>导出</a>
		</div>
	</div>
</form>


<script type="text/javascript">
//异步加载Standard, Subtype 和 Material
jQuery(document).ready(function() {
	jQuery('#type').change(function() {
		var requestData = {type_code: jQuery(this).children('option:selected').val()};
		jQuery('#standard').load('http://<?php echo base_url("index.php/pdms_pms/get_standard"); ?>', requestData);
		jQuery('#subtype').load('http://<?php echo base_url("index.php/pdms_pms/get_subtype"); ?>', requestData);
		jQuery('#material').load('http://<?php echo base_url("index.php/pdms_pms/get_material"); ?>', requestData);
	});

});
</script>
